from flask import Blueprint, request, send_file
import os
from utils import MyResponse, get_dir, get_global_config, handle_exception, handle_success
from Logger import logger
userhelp = Blueprint('userhelp', __name__)
@userhelp.route('/file/downloadUserHelpFile', methods=['POST'])
def download_user_help_file():
    try:
        run_dir = os.path.dirname(os.path.abspath(__file__))  # 根目录
        path = os.path.join(run_dir, 'static/helpFile/HelpFile.zip')
        res = send_file(path, as_attachment=True)
    except Exception as err:  # 捕获异常
        print(err)  # 打印异常参数
        res = MyResponse({"err": err}, False, "error").post()
        return res
    else:
        return res